import uvicorn
from fastapi import FastAPI
from starlette.staticfiles import StaticFiles

from FastAPI.url_demo.apps.FileDemo import fileDemo
from FastAPI.url_demo.apps.FormDemo import formDemo
from FastAPI.url_demo.apps.GetDemo import getDemo
from FastAPI.url_demo.apps.PostDemo import postDemo
from FastAPI.url_demo.apps.ResponseDemo import responseDemo

app = FastAPI()
# 静态文件
app.mount("/static",StaticFiles(directory="static")) # 目录在项目的根目录下

app.include_router(getDemo, prefix="/get", tags=["1.get用法", ])
app.include_router(postDemo, prefix="/post", tags=["2.post用法", ])
app.include_router(formDemo, prefix="/from", tags=["3.form用法", ])
app.include_router(fileDemo, prefix="/file", tags=["4.file用法", ])
app.include_router(responseDemo, prefix="/resp", tags=["4.响应参数", ])

if __name__ == '__main__':
    uvicorn.run("main:app", host="127.0.0.1", port=8080, reload=True)
